//
//  XYPerson.m
//  交换牌
//
//  Created by qianfeng on 15/8/9.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//

#import "XYPerson.h"

@implementation XYPerson

- (void)setLefthand:(XYhands*)lefthand andRighthand:(XYhands*)righthand{
    _lefthand = lefthand;
    _righthand = righthand;
}
- (XYhands*)getLefthand{

    return _lefthand;
}
- (XYhands*)getRighthand{

    return _righthand;
}

//抓牌

- (void)getLefthandPoker:(XYPoker*)poker1 andRighthandPoker:(XYPoker*)poker2{
   
    [_lefthand setPoker:poker1];
    [_righthand setPoker:poker2];

}


//换牌

- (void)exchangePoker{
    XYPoker * temp = [_lefthand getPoker];
    [_lefthand setPoker:[_righthand getPoker]];
    [_righthand setPoker:temp];

}


//展示牌


- (void)showPoker{
    char * colors[] = {"HONG_TAO","HEI_TAO","MEI_HUA","FANG_KUAI"};
    char * numbers[] = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"};

    XYPoker * poker1 = [_lefthand getPoker];
    XYPoker * poker2 = [_righthand getPoker];

    printf("花色:%s 数字:%s\n",colors[[poker1 getColor]],numbers[[poker1 getNumber]]);
    printf("花色:%s 数字:%s\n",colors[[poker2 getColor]],numbers[[poker2 getNumber]]);

}


@end




